:root {
  --primary: #4f5dff;
  --primary-light: rgba(79, 93, 255, 0.12);
  --primary-strong: #3c46d6;
  --surface: #ffffff;
  --surface-muted: #f4f6fb;
  --border: #e5e9f2;
  --text-main: #1f2533;
  --text-muted: #5f6c80;
  --success: #1fb47b;
  --warning: #f7a02c;
  --danger: #e35d6a;
  --shadow: 0 18px 44px rgba(79, 93, 255, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(180deg, #f4f6ff 0%, #eef2ff 100%);
  color: var(--text-main);
}

body {
  display: flex;
  justify-content: center;
  padding: 48px 18px 72px;
}

.app-shell {
  width: 1200px;
}

header.hero {
  background: var(--surface);
  border-radius: 20px;
  padding: 30px 34px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(79, 93, 255, 0.08);
  margin-bottom: 26px;
}

header.hero h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  color: var(--primary);
}

header.hero p {
  margin: 12px 0 22px;
  color: var(--text-muted);
  font-size: 15px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--text-muted);
  font-size: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
}

.status-dot.online {
  background: var(--success);
}

.tab-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.tab-btn {
  border: none;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 16px 32px rgba(79, 93, 255, 0.28);
}

.tab-btn:hover {
  transform: translateY(-1px);
}

section.view {
  background: var(--surface);
  border-radius: 20px;
  padding: 30px 34px;
  border: 1px solid rgba(79, 93, 255, 0.06);
  box-shadow: var(--shadow);
}

section.view h2 {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 600;
}

section.view h3 {
  margin: 24px 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

section.view h3:first-of-type {
  margin-top: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--surface-muted);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(79, 93, 255, 0.1);
}

.stat-card .label {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-card .value {
  font-size: 28px;
  font-weight: 600;
  color: var(--primary);
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 13px;
  color: var(--text-muted);
}

input,
select {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 14px;
  font-size: 14px;
  background: #fff;
  color: var(--text-main);
  transition: border-color 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 93, 255, 0.1);
}

.button-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.secondary {
  background: rgba(79, 93, 255, 0.16);
  color: var(--primary);
}

.btn.ghost {
  background: transparent;
  color: var(--primary);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(79, 93, 255, 0.24);
}

table.sheet {
  width: 100%;
  border-collapse: collapse;
}

table.sheet thead th {
  text-align: left;
  padding: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(79, 93, 255, 0.08);
  border-bottom: 1px solid rgba(79, 93, 255, 0.12);
}

table.sheet tbody td {
  padding: 14px;
  border-bottom: 1px solid rgba(79, 93, 255, 0.08);
  font-size: 13px;
}

table.sheet tbody tr:last-child td {
  border-bottom: none;
}

table.sheet tbody tr:hover {
  background: rgba(79, 93, 255, 0.05);
}

.status-chip-small {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(79, 93, 255, 0.12);
  color: var(--primary);
}

.status-chip-small.success {
  background: rgba(31, 180, 123, 0.14);
  color: var(--success);
}

.status-chip-small.warning {
  background: rgba(247, 160, 44, 0.16);
  color: var(--warning);
}

.status-chip-small.danger {
  background: rgba(227, 93, 106, 0.16);
  color: var(--danger);
}

.text-danger {
  color: var(--danger);
}

.empty-hint {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 20px;
}

.log-block {
  background: #10172a;
  color: #e0f2fe;
  border-radius: 16px;
  border: 1px solid rgba(79, 93, 255, 0.2);
  max-height: 420px;
  overflow-y: auto;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 12px;
  padding: 20px;
}

.log-line {
  margin-bottom: 8px;
}

.log-line.warn {
  color: #facc15;
}

.log-line.error {
  color: #fca5a5;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.form-helper {
  font-size: 12px;
  color: var(--text-muted);
}

.code-box {
  display: block;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  font-size: 12px;
  font-family: 'Fira Code', 'Courier New', monospace;
  margin-top: 20px;
  overflow-x: auto;
}

.feedback {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
}

.feedback.success {
  background: rgba(31, 180, 123, 0.12);
  color: var(--success);
}

.feedback.error {
  background: rgba(227, 93, 106, 0.12);
  color: var(--danger);
}
